webpackJsonp([7],{

/***/ 293:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(347)
/* template */
var __vue_template__ = __webpack_require__(351)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/video/index.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-252d0ad6", Component.options)
  } else {
    hotAPI.reload("data-v-252d0ad6", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 303:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _waves = __webpack_require__(304);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var install = function install(Vue) {
  Vue.directive('waves', _waves2.default);
};

if (window.Vue) {
  window.waves = _waves2.default;
  Vue.use(install); // eslint-disable-line
}

_waves2.default.install = install;
exports.default = _waves2.default;

/***/ }),

/***/ 304:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

__webpack_require__(305);

exports.default = {
  bind: function bind(el, binding) {
    el.addEventListener('click', function (e) {
      var customOpts = Object.assign({}, binding.value);
      var opts = Object.assign({
        ele: el, // 波纹作用元素
        type: 'hit', // hit 点击位置扩散 center中心点扩展
        color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
      }, customOpts);
      var target = opts.ele;
      if (target) {
        target.style.position = 'relative';
        target.style.overflow = 'hidden';
        var rect = target.getBoundingClientRect();
        var ripple = target.querySelector('.waves-ripple');
        if (!ripple) {
          ripple = document.createElement('span');
          ripple.className = 'waves-ripple';
          ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px';
          target.appendChild(ripple);
        } else {
          ripple.className = 'waves-ripple';
        }
        switch (opts.type) {
          case 'center':
            ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px';
            ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px';
            break;
          default:
            ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px';
            ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px';
        }
        ripple.style.backgroundColor = opts.color;
        ripple.className = 'waves-ripple z-active';
        return false;
      }
    }, false);
  }
};

/***/ }),

/***/ 305:
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__(306);
if(typeof content === 'string') content = [[module.i, content, '']];
// Prepare cssTransformation
var transform;

var options = {}
options.transform = transform
// add the styles to the DOM
var update = __webpack_require__(98)(content, options);
if(content.locals) module.exports = content.locals;
// Hot Module Replacement
if(false) {
	// When the styles change, update the <style> tags
	if(!content.locals) {
		module.hot.accept("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css", function() {
			var newContent = require("!!../../../../../node_modules/_css-loader@0.28.11@css-loader/index.js!./waves.css");
			if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
			update(newContent);
		});
	}
	// When the module is disposed, remove the <style> tags
	module.hot.dispose(function() { update(); });
}

/***/ }),

/***/ 306:
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__(6)(false);
// imports


// module
exports.push([module.i, ".waves-ripple {\n    position: absolute;\n    border-radius: 100%;\n    background-color: rgba(0, 0, 0, 0.15);\n    background-clip: padding-box;\n    pointer-events: none;\n    -webkit-user-select: none;\n    -moz-user-select: none;\n    -ms-user-select: none;\n    user-select: none;\n    -webkit-transform: scale(0);\n    -ms-transform: scale(0);\n    transform: scale(0);\n    opacity: 1;\n}\n\n.waves-ripple.z-active {\n    opacity: 0;\n    -webkit-transform: scale(2);\n    -ms-transform: scale(2);\n    transform: scale(2);\n    -webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out;\n    transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out;\n}", ""]);

// exports


/***/ }),

/***/ 347:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _dialog2 = __webpack_require__(348);

var _dialog3 = _interopRequireDefault(_dialog2);

var _auth = __webpack_require__(39);

var _waves = __webpack_require__(303);

var _waves2 = _interopRequireDefault(_waves);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// Waves directive
exports.default = {
    name: 'asset',
    components: {
        'el-dialog': _dialog3.default
    },
    directives: { waves: _waves2.default },
    data: function data() {
        return {
            list: this.$listDataSource({
                url: '/api/cms/video'
            }),
            model: this.$modelDataSource({
                url: '/api/cms/video',
                dataKey: 'model',
                attributes: {
                    id: 0,
                    tags: []
                }
            }),
            pageTitle: '视频素材',
            imgIndex: 0,
            currentPage: 1,
            parameter: {
                type: 'all',
                tags: ''
            },
            stateManager: {
                refreshList: true,
                editDialogVisible: false,
                editModelId: null,
                listLoading: true,
                buttonLoading: false
            },
            uploadAction: window.uploadHeaders,
            query: {
                page: 1,
                type: '',
                tags: []
            },
            //  点击退出变量
            isShow: false
        };
    },
    created: function created() {
        this.$store.commit('setPageTitle', '视频素材');
    },

    methods: {
        showVideo: function showVideo(path) {
            window.location.href = path;
        },

        showEditDialog: function showEditDialog(id) {
            this.stateManager.editDialogVisible = true;
            this.stateManager.editModelId = id;
            this.stateManager.buttonLoading = false;
        },
        uploadSuccessCallback: function uploadSuccessCallback(response, file) {
            var self = this;
            //上传成功回调
            this.$message({
                message: '成功上传',
                type: 'success'
            });
            this.stateManager.refreshList = true;
        },
        uploadFailedCallback: function uploadFailedCallback(error, file) {
            //上传失败回调
            this.$message.error('上传失败');
        },
        // 翻页
        handleCurrentChange: function handleCurrentChange(val) {
            this.currentPage = val;
            this.query.page = val;
            this.stateManager.refreshList = true;
        },


        // 删除
        deleteItem: function deleteItem(itemId) {
            var self = this;
            this.$confirm('确认删除吗，删除后不可恢复', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
                title: '删除确认'
            }).then(function () {
                self.model.uuid = itemId;
                self.model.destroy(function () {
                    self.stateManager.refreshList = true;
                    self.$message.success('删除成功');
                }, function (error) {
                    self.$message.error(error.response.data.state);
                });
            });
        },
        handleBeforeUpload: function handleBeforeUpload(file) {
            var isJPG = void 0;
            switch (file.type) {
                case 'video/mp4':
                    isJPG = true;
                    break;
                default:
                    isJPG = false;
            }
            var isLt2M = file.size / 1024 / 1024 < 10;

            if (!isJPG) {
                this.$message.error('上传视频只能是 mp4 格式!');
            }
            if (!isLt2M) {
                this.$message.error('上传视频大小不能超过 10MB!');
            }
            return isJPG && isLt2M;
        }
    },
    computed: {
        tableList: function tableList() {
            var self = this;
            if (this.stateManager.refreshList) {
                this.stateManager.listLoading = true;
                this.$store.dispatch('fetchTags');
                this.list.fetch(self.query, function () {
                    self.stateManager.refreshList = false;
                    self.stateManager.listLoading = false;
                });
            }
            return this.list;
        }
    }
}; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/***/ }),

/***/ 348:
/***/ (function(module, exports, __webpack_require__) {

var disposed = false
var normalizeComponent = __webpack_require__(4)
/* script */
var __vue_script__ = __webpack_require__(349)
/* template */
var __vue_template__ = __webpack_require__(350)
/* template functional */
var __vue_template_functional__ = false
/* styles */
var __vue_styles__ = null
/* scopeId */
var __vue_scopeId__ = null
/* moduleIdentifier (server only) */
var __vue_module_identifier__ = null
var Component = normalizeComponent(
  __vue_script__,
  __vue_template__,
  __vue_template_functional__,
  __vue_styles__,
  __vue_scopeId__,
  __vue_module_identifier__
)
Component.options.__file = "resources/assets/js/views/cms/video/_dialog.vue"

/* hot reload */
if (false) {(function () {
  var hotAPI = require("vue-loader/node_modules/vue-hot-reload-api")
  hotAPI.install(require("vue"), false)
  if (!hotAPI.compatible) return
  module.hot.accept()
  if (!module.hot.data) {
    hotAPI.createRecord("data-v-16261aea", Component.options)
  } else {
    hotAPI.reload("data-v-16261aea", Component.options)
  }
  module.hot.dispose(function (data) {
    disposed = true
  })
})()}

module.exports = Component.exports


/***/ }),

/***/ 349:
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
  value: true
});

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; //
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

var _vuex = __webpack_require__(38);

exports.default = {
  props: {
    stateManager: {
      type: Object
    }
  },
  data: function data() {
    return {
      model: this.$modelDataSource({
        url: '/api/cms/asset',
        dataKey: 'model',
        attributes: {
          id: 0,
          name: '',
          tags: []
        }
      }),
      isLoading: false,
      ruleValidate: {
        name: [{ required: true, message: '请填写素材名称', trigger: 'blur' }]
      }
    };
  },
  methods: {
    closeDialog: function closeDialog() {
      if (this.stateManager.buttonLoading) {
        return false;
      }
      this.stateManager.editDialogVisible = false;
      this.stateManager.listLoading = false;
      this.model.reset();
      this.$refs['model'].resetFields();
      this.stateManager.editModelId = 0;
    },
    saveModel: function saveModel() {
      var self = this;
      self.$refs['model'].validate(function (valid) {
        if (valid) {
          self.isLoading = false;
          self.stateManager.buttonLoading = true;
          self.model.save(function () {
            self.$message.success('保存成功');
            self.stateManager.refreshList = true;
            self.stateManager.buttonLoading = false;
            self.closeDialog();
          }, function (errors) {
            self.stateManager.buttonLoading = false;
            self.isLoading = false;
          });
        } else {
          console.log('表单验证失败');
        }
      });
    }
  },
  computed: _extends({}, (0, _vuex.mapGetters)(['tags']), {
    modalTitle: function modalTitle() {
      return '编辑素材信息';
    }
  }),
  watch: {
    'stateManager.editModelId': function stateManagerEditModelId(newValue) {
      var self = this;
      this.model.fetch(newValue, {}, function () {
        self.stateManager.editDialogVisible = true;
      }, function () {
        self.stateManager.listLoading = false;
      });
    }
  }
};

/***/ }),

/***/ 350:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { attrs: { id: "create-edit-container" } },
    [
      _c(
        "el-drawer",
        {
          ref: "drawer",
          attrs: {
            direction: "rtl",
            visible: _vm.stateManager.editDialogVisible,
            title: _vm.modalTitle,
            "custom-class": "demo-drawer",
            "before-close": _vm.closeDialog
          },
          on: {
            "update:visible": function($event) {
              return _vm.$set(_vm.stateManager, "editDialogVisible", $event)
            }
          }
        },
        [
          _c(
            "div",
            { staticClass: "dialog-drawer-content" },
            [
              _c(
                "el-form",
                {
                  ref: "model",
                  attrs: { model: _vm.model, rules: _vm.ruleValidate }
                },
                [
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 24 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "素材名称", prop: "name" } },
                            [
                              _c("el-input", {
                                attrs: { placeholder: "请填写素材名称" },
                                model: {
                                  value: _vm.model.name,
                                  callback: function($$v) {
                                    _vm.$set(_vm.model, "name", $$v)
                                  },
                                  expression: "model.name"
                                }
                              })
                            ],
                            1
                          )
                        ],
                        1
                      )
                    ],
                    1
                  ),
                  _vm._v(" "),
                  _c(
                    "el-row",
                    { attrs: { type: "flex", gutter: 20 } },
                    [
                      _c(
                        "el-col",
                        { attrs: { span: 24 } },
                        [
                          _c(
                            "el-form-item",
                            { attrs: { label: "素材标签", prop: "tags" } },
                            [
                              _c(
                                "el-select",
                                {
                                  staticStyle: { width: "100%" },
                                  attrs: {
                                    filterable: "",
                                    multiple: "",
                                    "allow-create": "",
                                    placeholder: "请选择素材标签"
                                  },
                                  model: {
                                    value: _vm.model.tags,
                                    callback: function($$v) {
                                      _vm.$set(_vm.model, "tags", $$v)
                                    },
                                    expression: "model.tags"
                                  }
                                },
                                _vm._l(_vm.tags, function(item, key) {
                                  return _c("el-option", {
                                    key: key,
                                    attrs: {
                                      label: item.label,
                                      value: item.label
                                    }
                                  })
                                }),
                                1
                              )
                            ],
                            1
                          )
                        ],
                        1
                      )
                    ],
                    1
                  )
                ],
                1
              ),
              _vm._v(" "),
              _c(
                "div",
                { staticClass: "dialog-drawer-footer" },
                [
                  _c(
                    "el-button",
                    {
                      attrs: { type: "ghost" },
                      on: { click: _vm.closeDialog }
                    },
                    [_vm._v("取消")]
                  ),
                  _vm._v(" "),
                  _c(
                    "el-button",
                    {
                      attrs: {
                        type: "primary",
                        loading: _vm.stateManager.buttonLoading
                      },
                      on: { click: _vm.saveModel }
                    },
                    [
                      _vm._v(
                        _vm._s(
                          _vm.stateManager.buttonLoading ? "提交中" : "确定"
                        )
                      )
                    ]
                  )
                ],
                1
              )
            ],
            1
          )
        ]
      )
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-16261aea", module.exports)
  }
}

/***/ }),

/***/ 351:
/***/ (function(module, exports, __webpack_require__) {

var render = function() {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "app-container" },
    [
      _c(
        "div",
        { staticClass: "filter-container" },
        [
          _c(
            "el-upload",
            {
              ref: "upload",
              attrs: {
                action: "/api/cms/video",
                multiple: "",
                data: _vm.parameter,
                headers: _vm.uploadAction,
                "show-file-list": false,
                "on-error": _vm.uploadFailedCallback,
                "before-upload": _vm.handleBeforeUpload,
                "on-success": _vm.uploadSuccessCallback
              }
            },
            [
              _c(
                "el-button",
                {
                  directives: [{ name: "waves", rawName: "v-waves" }],
                  staticClass: "filter-item",
                  attrs: { icon: "el-icon-upload", type: "primary" }
                },
                [_vm._v(" 添加新视频")]
              )
            ],
            1
          )
        ],
        1
      ),
      _vm._v(" "),
      [
        _c(
          "el-table",
          {
            directives: [
              {
                name: "loading",
                rawName: "v-loading",
                value: _vm.stateManager.listLoading,
                expression: "stateManager.listLoading"
              }
            ],
            staticStyle: { width: "100%", "min-height": "75vh" },
            attrs: {
              data: _vm.tableList.items,
              border: "",
              fit: "",
              "highlight-current-row": ""
            }
          },
          [
            _c("el-table-column", {
              attrs: { prop: "name", label: "文件名称", align: "center" }
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: { align: "center", prop: "tags", label: "标签" },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _vm._l(scope.row.tags, function(item) {
                        return [
                          _c(
                            "el-tag",
                            {
                              staticStyle: { "margin-right": "5px" },
                              attrs: { size: "mini" }
                            },
                            [_vm._v(_vm._s(item))]
                          )
                        ]
                      })
                    ]
                  }
                }
              ])
            }),
            _vm._v(" "),
            _c("el-table-column", {
              attrs: { label: "操作", width: "230", align: "center" },
              scopedSlots: _vm._u([
                {
                  key: "default",
                  fn: function(scope) {
                    return [
                      _c("el-button", {
                        directives: [{ name: "waves", rawName: "v-waves" }],
                        attrs: { size: "mini", icon: "fa fa-eye" },
                        on: {
                          click: function($event) {
                            return _vm.showVideo(scope.row.path)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("el-button", {
                        directives: [{ name: "waves", rawName: "v-waves" }],
                        attrs: {
                          size: "mini",
                          type: "success",
                          icon: "el-icon-edit-outline"
                        },
                        on: {
                          click: function($event) {
                            return _vm.showEditDialog(scope.row.id)
                          }
                        }
                      }),
                      _vm._v(" "),
                      _c("el-button", {
                        directives: [{ name: "waves", rawName: "v-waves" }],
                        attrs: {
                          size: "mini",
                          type: "danger",
                          icon: "el-icon-delete"
                        },
                        on: {
                          click: function($event) {
                            return _vm.deleteItem(scope.row.id)
                          }
                        }
                      })
                    ]
                  }
                }
              ])
            })
          ],
          1
        ),
        _vm._v(" "),
        _c(
          "div",
          { staticClass: "pagination-container" },
          [
            _c("el-pagination", {
              attrs: {
                background: "",
                layout: "prev, pager, next,total",
                "page-size": 15,
                total: _vm.list.total,
                "current-page": _vm.list.currentPage
              },
              on: { "current-change": _vm.handleCurrentChange }
            })
          ],
          1
        )
      ],
      _vm._v(" "),
      _c("el-dialog", { attrs: { stateManager: _vm.stateManager } })
    ],
    2
  )
}
var staticRenderFns = []
render._withStripped = true
module.exports = { render: render, staticRenderFns: staticRenderFns }
if (false) {
  module.hot.accept()
  if (module.hot.data) {
    require("vue-loader/node_modules/vue-hot-reload-api")      .rerender("data-v-252d0ad6", module.exports)
  }
}

/***/ })

});